Skip to content

[#339] Update frontend + SDK constants for Base mainnet#342

Merged
realproject7 merged 2 commits intomainfrom
task/339-mainnet-constants
Mar 19, 2026
Merged

[#339] Update frontend + SDK constants for Base mainnet#342
realproject7 merged 2 commits intomainfrom
task/339-mainnet-constants

Conversation

@realproject7
Copy link
Copy Markdown
Owner

Summary

  • Set mainnet StoryFactory address 0x66087c0032c304Eb724544ef8Fc7C7f3E6C8CdF5 in lib/contracts/constants.ts
  • Set mainnet PLOT_TOKEN to PL_TEST (0xF8A2C39111FCEB9C950aAf28A9E34EBaD99b85C1)
  • Update RESERVE_LABEL from "$PLOT" to "PL_TEST" for test phase
  • Add STORY_FACTORY_MAINNET_ADDRESS, MCV2_BOND_MAINNET_ADDRESS, DEPLOYMENT_BLOCK_MAINNET (43,559,145) to SDK
  • Update .env.example with mainnet addresses and comments

Test plan

  • npm run typecheck passes
  • npm run build succeeds
  • Constants switch correctly between testnet/mainnet based on NEXT_PUBLIC_CHAIN_ID

Fixes #339

🤖 Generated with Claude Code

- Set mainnet StoryFactory address 0x66087c0032c304Eb724544ef8Fc7C7f3E6C8CdF5
- Set mainnet PLOT_TOKEN to PL_TEST (0xF8A2C3...)
- Update RESERVE_LABEL mainnet from "$PLOT" to "PL_TEST"
- Add STORY_FACTORY_MAINNET_ADDRESS, MCV2_BOND_MAINNET_ADDRESS,
  DEPLOYMENT_BLOCK_MAINNET to SDK constants
- Update .env.example with mainnet addresses

Fixes #339

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Collaborator

@project7-interns project7-interns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: REQUEST CHANGES

Summary

The frontend constants look aligned with the deployed mainnet values, but the SDK side is still incomplete. The new mainnet constants are added, yet the PlotLink client continues to use Sepolia defaults even when configured for Base mainnet.

Findings

  • [high] The SDK client never switches to the new mainnet contract addresses or mainnet deployment block for chainId=8453.
    • File: packages/sdk/src/client.ts
    • Suggestion: when chainId === 8453, default storyFactory, mcv2Bond, and fromBlock to the mainnet constants instead of STORY_FACTORY_ADDRESS, MCV2_BOND_ADDRESS, and DEPLOYMENT_BLOCK (which still point to Sepolia / block 20_000_000). As written, a mainnet SDK client will query and transact against the wrong defaults.
  • [medium] The PR adds DEPLOYMENT_BLOCK_MAINNET, but the code paths that fetch logs still use DEPLOYMENT_BLOCK only.
    • File: packages/sdk/src/client.ts
    • Suggestion: select the deployment block by chain so mainnet log queries start from the actual deploy block 43_559_145.

Decision

Request changes because the ticket claims to update frontend + SDK constants for Base mainnet, but the SDK runtime still defaults to Sepolia values on mainnet.

Copy link
Copy Markdown
Collaborator

@project7-interns project7-interns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

T2b APPROVE

  • Addresses verified: StoryFactory 0x66087c..., MCV2_Bond 0xc5a076..., PL_TEST 0xF8A2C3... — all match deployed contracts from PR #24
  • Frontend constants: IS_TESTNET ternary correctly selects mainnet addresses; RESERVE_LABEL → "PL_TEST" for test phase ✓
  • SDK constants: Separate *_MAINNET_* exports with deployment block 43,559,145 ✓
  • .env.example: Documents both testnet/mainnet addresses ✓
  • CI green (lint-and-typecheck passes)

LGTM.

SDK constructor now defaults to mainnet StoryFactory, MCV2_Bond, and
deployment block when chainId=8453. Fixes incorrect Sepolia defaults
on mainnet.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Collaborator

@project7-interns project7-interns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: APPROVE

Summary

The follow-up commit fixes the SDK regression by selecting contract addresses and deployment block based on chainId. That closes the mainnet-defaulting gap while keeping the frontend constants aligned with the deployed contract.

Findings

  • [info] packages/sdk/src/client.ts now switches StoryFactory, MCV2_Bond, and log fromBlock to the mainnet constants when chainId=8453.

Decision

Approve because the PR now updates both frontend and SDK runtime behavior for Base mainnet as required by issue #339.

@realproject7 realproject7 merged commit 740cdd6 into main Mar 19, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Mainnet] Update frontend + SDK constants for Base mainnet

2 participants